﻿@using PhoneStoreWeb.Helpers;
@using System.IO;

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width" />
    <title>@ViewBag.Title</title>
    
    @Styles.Render("~/Content/css")
    @Scripts.Render("~/bundles/modernizr")
    
    <link href="~/Content/Style.css" rel="stylesheet" type="text/css" />
</head>
<body>
    @Scripts.Render("~/bundles/jquery")
    @RenderSection("scripts", required: false)
    <!-- Scripts -->
    <script src="~/Scripts/jquery.cycle.all.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            $('#slideshow').cycle({
                fx: 'fade' // choose your transition type, ex: fade, scrollUp, shuffle, etc...
            });
        });
    </script>

    <!-- Left, right banners -->
    <div id="divAdLeft">
        <embed src="~/Images/LeftBanner.swf" type="application/x-shockwave-flash" width="120" height="500" />
    </div>
    <div id="divAdRight">
        <embed src="~/Images/RightBanner.swf" type="application/x-shockwave-flash" width="120" height="500" />
    </div>
    <script src="~/Scripts/left-right-banners.js" type="text/javascript"></script>
    <script>
        document.write("<script type='text/javascript' language='javascript'>MainContentW = 1000;LeftBannerW = 120;RightBannerW = 120;LeftAdjust = 5;RightAdjust = 5;TopAdjust = 10;ShowAdDiv();window.onresize=ShowAdDiv;;<\/script>");
    </script>

    <div id="web-page">
        <div id="header">
            <div id="banner-submenu-login">
                <a href="~/" id="banner">
                    <embed src="~/Images/Logo.swf" type="application/x-shockwave-flash" width="500" height="200" />
                </a>
                <div id="submenu-login">
                    <div id="submenu">
                        <img src="~/Images/Icons/ShoppingCart.png" alt="" width="48" height="48" />
                        <a href="~/ShoppingCart">Giỏ hàng:</a>
                        <span>@Html.Action("CartSummary", "ShoppingCart")</span>
                        <img src="~/Images/Icons/Contact.png" alt="" width="25" height="35" />
                        <a href="~/Home/Contact">Liên hệ</a>
                        <img src="~/Images/Icons/Recruitment.png" alt="" width="25" height="35" />
                        <a href="~/Home/Recruitment">Tuyển dụng</a>
                    </div>
                    @Html.Action("LogIn", "Account")
                </div>
            </div>
            <div id="menu">
                <ul>
                    @Html.MenuItem("TRANG CHỦ", "Index", "Home", "menu-item-activated")
                    @Html.MenuItem("GIỚI THIỆU", "Introduction", "Home", "menu-item-activated")
                    @Html.MenuItem("ĐIỆN THOẠI DI ĐỘNG", "Smartphone", "Product", "menu-item-activated")
                    @Html.MenuItem("MÁY TÍNH BẢNG", "Tablet", "Product", "menu-item-activated")
                    @Html.MenuItem("KHUYẾN MÃI", "Promotion", "Product", "menu-item-activated")
                    @Html.MenuItem("BÁO GIÁ", "PriceList", "Home", "menu-item-activated")
                </ul>
            </div>
            <div id="slideshow">
                @{
                    String path = HttpContext.Current.Server.MapPath("~/Images/SlideShow");
                    IEnumerable<string> filePaths = Directory.EnumerateFiles(path, "*.png");
                
                    foreach (string item in filePaths)
                    {
                        <img src="@Url.Content("~/Images/SlideShow/" + Path.GetFileName(item))" alt="@Path.GetFileName(item)" width="948" height="300" />
                    }
                }
            </div>
        </div>
        <div id="content">
            <div id="left-panel">
                <div id="left-menu">
                    <a href="#"><img src="~/Images/ProductMenu.png" alt="" width="200" height="30" /></a>
                    @RenderSection("LeftMenu", required: false)
                </div>
                <div id="visitors">
                    <a href="#"><img src="~/Images/Visitors.png" alt="" width="200" height="30" /></a>
                    @Html.Action("Visitors", "Account")
                </div>
                <div id="ads">
                    @{
                        path = HttpContext.Current.Server.MapPath("~/Images/Ads");
                        filePaths = Directory.EnumerateFiles(path, "*.*", SearchOption.AllDirectories)
                                    .Where(s => s.EndsWith(".png") || s.EndsWith(".swf"));
                
                        foreach (string item in filePaths)
                        {
                            if (item.EndsWith(".png"))
                            {
                                <img src="@Url.Content("~/Images/Ads/" + Path.GetFileName(item))" alt="@Path.GetFileName(item)" width="200" height="230" />
                            }
                            else if (item.EndsWith(".swf"))
                            {
                                <embed src="@Url.Content("~/Images/Ads/" + Path.GetFileName(item))" type="application/x-shockwave-flash" width="200" height="230" />
                            }
                        }
                    }
                </div>
            </div>
            <div id="main-content">
                <div id="right-menu">
                    @RenderSection("RightMenu", required: false)
                </div>
                <div id="primary-content">
                    @RenderBody()
                </div>
            </div>
        </div>
        <div id="footer">
            <ul>
                <li><a href="~/Home/Index">Trang chủ</a><strong> | </strong></li>
                <li><a href="~/Home/Introduction">Giới thiệu</a><strong> | </strong></li>
                <li><a href="~/Product/Smartphone">Điện thoại di động</a><strong> | </strong></li>
                <li><a href="~/Product/Tablet">Máy tính bảng</a><strong> | </strong></li>
                <li><a href="~/Home/Contact">Liên hệ</a><strong> | </strong></li>
                <li><a href="~/Home/Recruitment">Tuyển dụng</a></li>
            </ul>
            <hr />
            <div>
                <p>CÔNG TY CỔ PHẦN ĐIỆN THOẠI MPS</p>
                Trụ sở chính: MPS Building 244 Cống Quỳnh, P.Phạm Ngũ Lão, Quận 1, Tp.HCM
                <br />
                ĐT: (08).3925.9999 - 1900.1810 (Ext:250) - Fax: 08.39259119
                <br />
                Giấy chứng nhận ĐKKD số: 0304722166 do Sở KH&ĐT TP.HCM cấp ngày 28/06/2007.
                <br />
                Website: <a href="http://www.mps.com">www.mps.com.vn</a> - Email: <a href="#">lienhe@mps.com.vn</a>
            </div>
            <div>
                <img src="~/Images/MPS.png" alt="MPS.png" width="100" height="40"/>
                <p>Copyright © 2013. Developed by <a href="http://www.mps.com">MPS</a> Solution</p>
            </div>
        </div>
    </div>    
</body>
</html>